From 22de0a66e5edcbc5b386e347596c88a65318ac94 Mon Sep 17 00:00:00 2001 From: "Matteo F. Vescovi" Date: Fri, 2 Jun 2017 14:15:16 +0200 Subject: [PATCH] New upstream version 0.1.28 --- AUTHORS | 2 + INSTALL | 10 +-- Makefile.in | 2 +- NEWS | 3 + README | 9 ++- babl/babl-version.h | 2 +- configure | 30 ++++----- configure.ac | 2 +- extensions/CIE.c | 144 ++++++++++++++++++++++++++++++++++++++++++++ extensions/cairo.c | 44 ++++++++++++++ 10 files changed, 223 insertions(+), 25 deletions(-) diff --git a/AUTHORS b/AUTHORS index 01b5dbf..04ad3ae 100644 --- a/AUTHORS +++ b/AUTHORS @@ -74,4 +74,6 @@
Portability, Stability and more
Massimo Valentini
stability fixes
+
Ell
+
fast paths
diff --git a/INSTALL b/INSTALL index 24a3c8b..d011898 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ -babl 0.1.26 +babl 0.1.28 Dynamic; any to any, pixel format conversion library. @@ -12,10 +12,10 @@ From a released version the following is the expected method of installation (or a variation on this theme): ------------------------------------------------------------ - foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.26.tar.bz2 - foo$ tar jxf babl-0.1.26.tar.gz - foo$ cd babl-0.1.26 - foo/babl-0.1.26$ ./configure && make && sudo make install + foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.28.tar.bz2 + foo$ tar jxf babl-0.1.28.tar.gz + foo$ cd babl-0.1.28 + foo/babl-0.1.28$ ./configure && make && sudo make install ------------------------------------------------------------ diff --git a/Makefile.in b/Makefile.in index 86bde56..98b34ed 100644 --- a/Makefile.in +++ b/Makefile.in @@ -195,7 +195,7 @@ DIST_SUBDIRS = babl extensions tests tools docs am__DIST_COMMON = $(srcdir)/INSTALL.in $(srcdir)/Makefile.in \ $(srcdir)/babl.pc.in $(srcdir)/config.h.in AUTHORS COPYING \ INSTALL NEWS README TODO compile config.guess config.sub \ - install-sh ltmain.sh missing + depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff --git a/NEWS b/NEWS index 64f2a22..b91eb36 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ the news section both in the README and the webpage. --> +2017-05-30 babl-0.1.28
+Fast paths for Lav <-> Lch, release triggered by pending GIMP release. +
2017-05-09 babl-0.1.26
Build and install HCY color space, platform independences fixes to fish cache.
diff --git a/README b/README index c70899b..6be3cd6 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Babl-0.1.26 +Babl-0.1.28 Contents @@ -59,6 +59,9 @@ babl release. If there are significant improvements to babl when a GEGL release is done a babl release is most often put out just prior to the GEGL release. +2017-05-30 babl-0.1.28 + Fast paths for Lav <-> Lch, release triggered by pending GIMP + release. 2017-05-09 babl-0.1.26 Build and install HCY color space, platform independences fixes to fish cache. @@ -2144,5 +2147,7 @@ Jon Nordby Portability, Stability and more Massimo Valentini stability fixes +Ell + fast paths -/babl-0.1.26 +/babl-0.1.28 diff --git a/babl/babl-version.h b/babl/babl-version.h index c418730..5f1a1f7 100644 --- a/babl/babl-version.h +++ b/babl/babl-version.h @@ -34,7 +34,7 @@ #define BABL_MAJOR_VERSION 0 #define BABL_MINOR_VERSION 1 -#define BABL_MICRO_VERSION 26 +#define BABL_MICRO_VERSION 28 /** Get the version information on the babl library */ void babl_get_version (int *major, diff --git a/configure b/configure index 82c7e48..ee18444 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for babl 0.1.26. +# Generated by GNU Autoconf 2.69 for babl 0.1.28. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='babl' PACKAGE_TARNAME='babl' -PACKAGE_VERSION='0.1.26' -PACKAGE_STRING='babl 0.1.26' +PACKAGE_VERSION='0.1.28' +PACKAGE_STRING='babl 0.1.28' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures babl 0.1.26 to adapt to many kinds of systems. +\`configure' configures babl 0.1.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1452,7 +1452,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of babl 0.1.26:";; + short | recursive ) echo "Configuration of babl 0.1.28:";; esac cat <<\_ACEOF @@ -1572,7 +1572,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -babl configure 0.1.26 +babl configure 0.1.28 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1937,7 +1937,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by babl $as_me 0.1.26, which was +It was created by babl $as_me 0.1.28, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2293,11 +2293,11 @@ ac_config_headers="$ac_config_headers config.h" BABL_MAJOR_VERSION=0 BABL_MINOR_VERSION=1 -BABL_MICRO_VERSION=26 +BABL_MICRO_VERSION=28 BABL_INTERFACE_AGE=1 -BABL_BINARY_AGE=126 -BABL_VERSION=0.1.26 -BABL_REAL_VERSION=0.1.26 +BABL_BINARY_AGE=128 +BABL_VERSION=0.1.28 +BABL_REAL_VERSION=0.1.28 BABL_API_VERSION=0.1 @@ -2332,7 +2332,7 @@ fi -BABL_LIBRARY_VERSION="125:1:125" +BABL_LIBRARY_VERSION="127:1:127" BABL_CURRENT_MINUS_AGE=0 @@ -2964,7 +2964,7 @@ fi # Define the identity of the package. PACKAGE='babl' - VERSION='0.1.26' + VERSION='0.1.28' # Some tools Automake needs. @@ -14854,7 +14854,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by babl $as_me 0.1.26, which was +This file was extended by babl $as_me 0.1.28, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14920,7 +14920,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -babl config.status 0.1.26 +babl config.status 0.1.28 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ff256d2..1f44e53 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ AC_PREREQ(2.54) m4_define([babl_major_version], [0]) m4_define([babl_minor_version], [1]) -m4_define([babl_micro_version], [26]) +m4_define([babl_micro_version], [28]) m4_define([babl_real_version], [babl_major_version.babl_minor_version.babl_micro_version]) m4_define([babl_version], [babl_real_version]) diff --git a/extensions/CIE.c b/extensions/CIE.c index a6c8439..040c03c 100644 --- a/extensions/CIE.c +++ b/extensions/CIE.c @@ -808,6 +808,126 @@ Labaf_to_rgbaf (float *src, return samples; } +static long +Labf_to_Lchabf (float *src, + float *dst, + long samples) +{ + long n = samples; + + while (n--) + { + float L = src[0]; + float A = src[1]; + float B = src[2]; + + float C = sqrtf (A * A + B * B); + float H = atan2f (B, A) * DEGREES_PER_RADIAN; + + // Keep H within the range 0-360 + if (H < 0.0f) + H += 360.0f; + + dst[0] = L; + dst[1] = C; + dst[2] = H; + + src += 3; + dst += 3; + } + + return samples; +} + +static long +Lchabf_to_Labf (float *src, + float *dst, + long samples) +{ + long n = samples; + + while (n--) + { + float L = src[0]; + float C = src[1]; + float H = src[2]; + + float A = C * cosf (H * RADIANS_PER_DEGREE); + float B = C * sinf (H * RADIANS_PER_DEGREE); + + dst[0] = L; + dst[1] = A; + dst[2] = B; + + src += 3; + dst += 3; + } + + return samples; +} + +static long +Labaf_to_Lchabaf (float *src, + float *dst, + long samples) +{ + long n = samples; + + while (n--) + { + float L = src[0]; + float A = src[1]; + float B = src[2]; + float a = src[3]; + + float C = sqrtf (A * A + B * B); + float H = atan2f (B, A) * DEGREES_PER_RADIAN; + + // Keep H within the range 0-360 + if (H < 0.0f) + H += 360.0f; + + dst[0] = L; + dst[1] = C; + dst[2] = H; + dst[3] = a; + + src += 4; + dst += 4; + } + + return samples; +} + +static long +Lchabaf_to_Labaf (float *src, + float *dst, + long samples) +{ + long n = samples; + + while (n--) + { + float L = src[0]; + float C = src[1]; + float H = src[2]; + float a = src[3]; + + float A = C * cosf (H * RADIANS_PER_DEGREE); + float B = C * sinf (H * RADIANS_PER_DEGREE); + + dst[0] = L; + dst[1] = A; + dst[2] = B; + dst[3] = a; + + src += 4; + dst += 4; + } + + return samples; +} + static void conversions (void) { @@ -889,6 +1009,30 @@ conversions (void) "linear", lchaba_to_rgba, NULL ); + babl_conversion_new ( + babl_format ("CIE Lab float"), + babl_format ("CIE LCH(ab) float"), + "linear", Labf_to_Lchabf, + NULL + ); + babl_conversion_new ( + babl_format ("CIE LCH(ab) float"), + babl_format ("CIE Lab float"), + "linear", Lchabf_to_Labf, + NULL + ); + babl_conversion_new ( + babl_format ("CIE Lab alpha float"), + babl_format ("CIE LCH(ab) alpha float"), + "linear", Labaf_to_Lchabaf, + NULL + ); + babl_conversion_new ( + babl_format ("CIE LCH(ab) alpha float"), + babl_format ("CIE Lab alpha float"), + "linear", Lchabaf_to_Labaf, + NULL + ); /*babl_conversion_new ( babl_model ("RGBA"), babl_model ("CIE XYZ"), diff --git a/extensions/cairo.c b/extensions/cairo.c index 5569ab6..6066258 100644 --- a/extensions/cairo.c +++ b/extensions/cairo.c @@ -104,6 +104,43 @@ conv_rgbA8_premul_cairo32_le (unsigned char *src, unsigned char *dst, long sampl } #endif +static long conv_cairo32_rgbA8_premul_le (unsigned char *src, unsigned char *dst, long samples) +{ + long n = samples; + while (n--) + { + unsigned char blue = *src++; + unsigned char green = *src++; + unsigned char red = *src++; + unsigned char alpha = *src++; + + *dst++ = red; + *dst++ = green; + *dst++ = blue; + *dst++ = alpha; + } + return samples; +} + + +static long conv_cairo32_rgbAF_premul_le (unsigned char *src, unsigned char *dst_char, long samples) +{ + long n = samples; + float *dst = (void*)dst_char; + while (n--) + { + unsigned char blue = *src++; + unsigned char green = *src++; + unsigned char red = *src++; + unsigned char alpha = *src++; + + *dst++ = red / 255.0; + *dst++ = green / 255.0; + *dst++ = blue / 255.0; + *dst++ = alpha / 255.0; + } + return samples; +} static inline long conv_rgbA8_cairo32_le (unsigned char *src, unsigned char *dst, long samples) @@ -359,6 +396,13 @@ init (void) babl_component ("PAD"), NULL ); + + babl_conversion_new (f32, babl_format ("R'aG'aB'aA float"), "linear", + conv_cairo32_rgbAF_premul_le, NULL); + + babl_conversion_new (f32, babl_format ("R'aG'aB'aA u8"), "linear", + conv_cairo32_rgbA8_premul_le, NULL); + babl_conversion_new (babl_format ("R'aG'aB'aA u8"), f32, "linear", conv_rgbA8_premul_cairo32_le, NULL); -- 2.30.2